<!--菜单添加-->
<div class="dialog_content">
    <form id="info_form" name="info_form" action="{:U('Companybranch/add')}" method="post">
        <table width="100%" class="table_form">
            <tr>
                <th width="100">上级部门 :</th>
                <td>
                    <select name="pid">
                        <option value="0">作为一级菜单</option>
                        {$select_menus}
                    </select>
                </td>
            </tr>
            <tr>
                <th>部门名称 :</th>
                <td><input type="text" name="name" id="name" class="input-text"></td>
            </tr>
            <tr>
                <th width="100">所在城市 :</th>
                <td>
                    <select name="city">
                        <foreach name="job_city" item="val">
                            <option value="{$val}">{$val}</option>
                        </foreach>
                    </select>
                </td>
            </tr>
            <tr>
                <th>备注 :</th>
                <td><textarea name="remark" id="remark" cols="40" rows="3"></textarea></td>
            </tr>
        </table>
    </form>
</div>
<script>
    $(function(){

        $.formValidator.initConfig({formid:"info_form",autotip:true});
        $("#name").formValidator({ onshow:lang.please_input+'部门名', onfocus:lang.please_input+'部门名', oncorrect:lang.input_right}).inputValidator({ min:1, onerror:lang.please_input+'部门名'});

        $('#info_form').ajaxForm({success:complate,dataType:'json'});
        function complate(result){
            if(result.errNum === 0){
                $.dialog.get('add').close();
                $.yhxia.tip({content:result.retData});
                window.location.reload();
            } else {
                $.yhxia.tip({content:result.errMsg, icon:'alert'});
            }
        }
    })
</script>